package whf.shop.entity;

import org.apache.struts.upload.FormFile;

import whf.framework.file.IFile;
import whf.framework.file.IFolder;
import whf.framework.file.IType;

/**
 * @author wanghaifeng
 * @create Mar 28, 2007 10:23:52 PM
 * 
 */
public class Product extends whf.framework.entity.AbstractEntity implements
		IFile {

	private static final long serialVersionUID = 0;

	private whf.shop.entity.Shop shop;

	private whf.shop.entity.ProductCategory category;

	/**
	 * 图片
	 * 
	 * @property String:imageFile
	 */
	private String imageFile;

	/**
	 * 积分
	 * 
	 * @property int:cents
	 */
	private int cents;

	/**
	 * 价格
	 * 
	 * @property float:price
	 */
	private float price;

	/**
	 * 库存
	 * 
	 * @property int:stock
	 */
	private int stock;

	/**
	 * 折扣
	 * 
	 * @property float:discount
	 */
	private float discount;

	/**
	 * 零售价
	 * 
	 * @property float:retailPrice
	 */
	private float retailPrice;

	/**
	 * 体积
	 * 
	 * @property String:size
	 */
	private String size;

	/**
	 * 重量
	 * 
	 * @property double:weight
	 */
	private double weight;

	//
	private FormFile imageFileFile;

	// ---------- methods ----------

	public void setShop(whf.shop.entity.Shop shop) {
		this.shop = shop;
	}

	public whf.shop.entity.Shop getShop() {
		return this.shop;
	}

	public void setCategory(whf.shop.entity.ProductCategory category) {
		this.category = category;
	}

	public whf.shop.entity.ProductCategory getCategory() {
		return this.category;
	}

	public void setImageFile(String imageFile) {
		this.imageFile = imageFile;
	}

	public String getImageFile() {
		return this.imageFile;
	}

	public void setCents(int cents) {
		this.cents = cents;
	}

	public int getCents() {
		return this.cents;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public float getPrice() {
		return this.price;
	}

	public void setStock(int stock) {
		this.stock = stock;
	}

	public int getStock() {
		return this.stock;
	}

	public void setDiscount(float discount) {
		this.discount = discount;
	}

	public float getDiscount() {
		return this.discount;
	}

	public void setRetailPrice(float retailPrice) {
		this.retailPrice = retailPrice;
	}

	public float getRetailPrice() {
		return this.retailPrice;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getSize() {
		return this.size;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}

	public double getWeight() {
		return this.weight;
	}

	/**
	 * @return Returns the imageFileFile.
	 */
	public FormFile getImageFileFile() {
		return imageFileFile;
	}

	/**
	 * @param imageFileFile
	 *            The imageFileFile to set.
	 */
	public void setImageFileFile(FormFile imageFileFile) {
		this.imageFileFile = imageFileFile;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.file.IFile#getFileFolder()
	 */
	public IFolder getFileFolder() {
		return this.category;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.file.IFile#getFileType()
	 */
	public IType getFileType() {
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.file.IFile#getPhycialPath()
	 */
	public String getPhycialPath() {
		return this.imageFile;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.file.IFile#getVersion()
	 */
	public String getVersion() {
		return null;
	}

}